<template>
  <view class="my-search-container" :style="{ 'background-color': bgcolor }" @click="searchHandle">
    <view class="search-box" :style="{ 'border-radius': radius + 'px'}">
      <icon type="search" color="#080808" size="15px"></icon>
      <!-- <uni-search-bar>搜索</uni-search-bar> -->
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props: {
      // 背景颜色
      bgcolor: {
        type: String,
        default: '#c00000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        default: 15
      }
    },
    data() {
      return {
        
      };
    },
    methods: {
      searchHandle() {
        this.$emit('toSearch')
      }
    }
  }
</script>

<style lang="scss" scoped>
.my-search-container{
  display: flex; 
  align-items: center;
  padding: 0 15px;
  text-align: center;
  height: 50px;
  // background-color: #c00000;
  .search-box{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 100%;
    // border-radius: 20px;
    background-color: #ffffff;
  }
  .placeholder{
    font-size: 15px;
    margin-left: 5px;
  }
}
</style>